home *** CD-ROM | disk | FTP | other *** search
- /* A lexical scanner generated by flex */
-
- /* scanner skeleton version:
- * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
- */
-
- #define FLEX_SCANNER
-
- #include <stdio.h>
-
-
- /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
- #ifdef c_plusplus
- #ifndef __cplusplus
- #define __cplusplus
- #endif
- #endif
-
-
- #ifdef __cplusplus
-
- #include <stdlib.h>
- #include <osfcn.h>
-
- /* use prototypes in function declarations */
- #define YY_USE_PROTOS
-
- /* the "const" storage-class-modifier is valid */
- #define YY_USE_CONST
-
- #else /* ! __cplusplus */
-
- #ifdef __STDC__
-
- #ifdef __GNUC__
- #include <stddef.h>
- void *malloc( size_t );
- void free( void* );
- #else
- #include <stdlib.h>
- #endif /* __GNUC__ */
-
- #define YY_USE_PROTOS
- #define YY_USE_CONST
-
- #endif /* __STDC__ */
- #endif /* ! __cplusplus */
-
-
- #ifdef __TURBOC__
- #define YY_USE_CONST
- #endif
-
- #ifdef atarist
- #include <stdlib.h>
- #include <string.h>
- #include <memory.h>
- int _yyread(int fd, char *buf, int size);
-
- #define YY_INPUT(buf,result,max_size) \
- if ( (result = _yyread( fileno(yyin), (char *) buf, max_size )) < 0 ) \
- YY_FATAL_ERROR( "read() in flex scanner failed" );
- #endif
-
-
- #ifndef YY_USE_CONST
- #define const
- #endif
-
-
- #ifdef YY_USE_PROTOS
- #define YY_PROTO(proto) proto
- #else
- #define YY_PROTO(proto) ()
- /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
- * so it's got to be a K&R compiler, and therefore there's no standard
- * place from which to include these definitions
- */
- char *malloc();
- int free();
- int read();
- #endif
-
-
- /* amount of stuff to slurp up with each read */
- #ifndef YY_READ_BUF_SIZE
- #define YY_READ_BUF_SIZE 8192
- #endif
-
- /* returned upon end-of-file */
- #define YY_END_TOK 0
-
- /* copy whatever the last rule matched to the standard output */
-
- /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
- /* this used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite()
- */
- #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
-
- /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
- #ifndef YY_INPUT
- #define YY_INPUT(buf,result,max_size) \
- if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
- YY_FATAL_ERROR( "read() in flex scanner failed" );
- #endif
- #define YY_NULL 0
-
- /* no semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
- #define yyterminate() return ( YY_NULL )
-
- /* report a fatal error */
-
- /* The funky do-while is used to turn this macro definition into
- * a single C statement (which needs a semi-colon terminator).
- * This avoids problems with code like:
- *
- * if ( something_happens )
- * YY_FATAL_ERROR( "oops, the something happened" );
- * else
- * everything_okay();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the YY_FATAL_ERROR() call.
- */
-
- #define YY_FATAL_ERROR(msg) \
- do \
- { \
- (void) fputs( msg, stderr ); \
- (void) putc( '\n', stderr ); \
- exit( 1 ); \
- } \
- while ( 0 )
-
- /* default yywrap function - always treat EOF as an EOF */
- #define yywrap() 1
-
- /* enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN
- */
- #define BEGIN yy_start = 1 + 2 *
-
- /* action number for EOF rule of a given start state */
- #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
- /* special action meaning "start processing a new file" */
- #define YY_NEW_FILE \
- do \
- { \
- yy_init_buffer( yy_current_buffer, yyin ); \
- yy_load_buffer_state(); \
- } \
- while ( 0 )
-
- /* default declaration of generated scanner - a define so the user can
- * easily add parameters
- */
- #define YY_DECL int yylex YY_PROTO(( void ))
-
- /* code executed at the end of each rule */
- #define YY_BREAK break;
-
- #define YY_END_OF_BUFFER_CHAR 0
-
- #ifndef YY_BUF_SIZE
- #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
- #endif
-
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
- #define YY_CHAR unsigned char
- # line 1 "lacheck.lex"
- #define INITIAL 0
- # line 2 "lacheck.lex"
- /* -*- Mode: C -*-
- *
- * lacheck.lex - A consistency checker checker for LaTeX documents
- *
- * Copyright (C) 1991 Kresten Krab Thorup (krab@iesd.auc.dk).
- *
- * $Locker: krab $
- * $Revision: 1.15 $
- * Author : Kresten Krab Thorup
- * Created On : Sun May 26 18:11:58 1991
- * Last Modified By: Kresten Krab Thorup
- * Last Modified On: Sat Jun 6 16:40:19 1992
- * Update Count : 51
- *
- * HISTORY
- * 6-Jun-1992 Kresten Krab Thorup
- * Last Modified: Sat Jun 6 16:37:44 1992 #48 (Kresten Krab Thorup)
- * Added test for whitespace before punctation mark
- * 17-Dec-1991 (Last Mod: Tue Dec 17 21:01:24 1991 #41) Kresten Krab Thorup
- * Added 'word word` and missing ~ before cite and ref
- * 18-Jun-1991 (Last Mod: Tue Jun 18 19:20:43 1991 #17) Kresten Krab Thorup
- * Added check (or rather management) for \newenvironment and
- * \newcommand - as suggested by Per Abrahamsen abrham@hugin.dk
- * 30-May-1991 (Last Mod: Thu May 30 02:22:33 1991 #15) Kresten Krab Thorup
- * Added check for `$${punct}' and `{punct}$' constructions
- * 30-May-1991 (Last Mod: Wed May 29 10:31:35 1991 #6) Kresten Krab Thorup
- * Improved (dynamic) stack management from Andreas Stolcke ...
- * <stolcke@ICSI.Berkeley.EDU>
- * 26-May-1991 Kresten Krab Thorup
- * Initial distribution version.
- */
-
- /* * Last edited: Jun 6 16:40 1992 (krab) */
-
- #include <stdio.h>
- #include <string.h>
- #include <sys/param.h>
-
- /* extern char *realloc(); */ /* mj - don't declare - this is in headers */
-
- #ifdef NEED_STRSTR
- char *strstr(char *, char*); /* mj - provide prototype in case if needed */
- #endif
-
- #define GROUP_STACK_SIZE 10
- #define INPUT_STACK_SIZE 10
-
- #define PROGNAME "LaCheck"
-
- /* macros */
-
- #define CG_NAME gstack[gstackp-1].s_name
- #define CG_TYPE gstack[gstackp-1].s_type
- #define CG_LINE gstack[gstackp-1].s_line
- #define CG_FILE gstack[gstackp-1].s_file
-
- char *bg_command();
- void pop();
- void push();
- void g_checkend();
- void e_checkend();
- void f_checkend();
- void input_file();
- void print_bad_match();
- int check_top_level_end();
-
- /* global variables */
-
- char returnval[100];
- int line_count = 1;
- int warn_count = 0;
- char *file_name;
- char verb_char;
-
- /* the group stack */
-
- typedef struct tex_group
- {
- unsigned char *s_name;
- int s_type;
- int s_line;
- char *s_file;
- } tex_group;
-
- tex_group *gstack;
- int gstack_size = GROUP_STACK_SIZE;
- int gstackp = 0;
-
- typedef struct input_
- {
- YY_BUFFER_STATE stream;
- char *name;
- int linenum;
- } input_;
-
- input_ *istack;
- int istack_size = INPUT_STACK_SIZE;
- int istackp = 0;
-
- int def_count = 0;
-
- #define B_ENVIRONMENT 1
- #define E_ENVIRONMENT 2
- #define VERBATIM 3
- #define INCLUDE 4
- #define MATH 5
- #define COMMENT 6
- #define VERB 7
- #define DEF 8
- #define AFTER_DISPLAY 9
- #define ENV_DEF 10
- # line 144 "lacheck.lex"
-
- /* done after the current pattern has been matched and before the
- * corresponding action - sets up yytext
- */
- #define YY_DO_BEFORE_ACTION \
- yytext = yy_bp; \
- yyleng = yy_cp - yy_bp; \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
-
- #define EOB_ACT_CONTINUE_SCAN 0
- #define EOB_ACT_END_OF_FILE 1
- #define EOB_ACT_LAST_MATCH 2
-
- /* return all but the first 'n' matched characters back to the input stream */
- #define yyless(n) \
- do \
- { \
- /* undo effects of setting up yytext */ \
- *yy_cp = yy_hold_char; \
- yy_c_buf_p = yy_cp = yy_bp + n; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
- #define unput(c) yyunput( c, yytext )
-
-
- struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- YY_CHAR *yy_ch_buf; /* input buffer */
- YY_CHAR *yy_buf_pos; /* current position in input buffer */
-
- /* size of input buffer in bytes, not including room for EOB characters*/
- int yy_buf_size;
-
- /* number of characters read into yy_ch_buf, not including EOB characters */
- int yy_n_chars;
-
- int yy_eof_status; /* whether we've seen an EOF on this buffer */
- #define EOF_NOT_SEEN 0
- /* "pending" happens when the EOF has been seen but there's still
- * some text process
- */
- #define EOF_PENDING 1
- #define EOF_DONE 2
- };
-
- static YY_BUFFER_STATE yy_current_buffer;
-
- /* we provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state"
- */
- #define YY_CURRENT_BUFFER yy_current_buffer
-
-
- /* yy_hold_char holds the character lost when yytext is formed */
- static YY_CHAR yy_hold_char;
-
- static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-
- #ifndef YY_USER_ACTION
- #define YY_USER_ACTION
- #endif
-
- #ifndef YY_USER_INIT
- #define YY_USER_INIT
- #endif
-
- extern YY_CHAR *yytext;
- extern int yyleng;
- extern FILE *yyin, *yyout;
-
- YY_CHAR *yytext;
- int yyleng;
-
- FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
- #define YY_END_OF_BUFFER 66
- typedef int yy_state_type;
- static const short int yy_acclist[204] =
- { 0,
- 66, 64, 65, 64, 65, 4, 65, 64, 65, 64,
- 65, 26, 64, 65, 3, 58, 64, 65, 64, 65,
- 64, 65, 64, 65, 64, 65, 64, 65, 64, 65,
- 64, 65, 8, 64, 65, 9, 64, 65, 64, 65,
- 32, 65, 65, 41, 65, 35, 65, 34, 35, 65,
- 36, 65, 35, 65, 62, 65, 60, 65, 59, 65,
- 38, 65, 13, 65, 4, 65, 3, 13, 65, 13,
- 65, 11, 13, 65, 12, 13, 65, 23, 65, 24,
- 65, 22, 23, 65, 17, 65, 3, 17, 65, 17,
- 65, 15, 17, 65, 16, 17, 65, 57, 46, 25,
-
- 27, 3, 3, 7, 2, 18, 19, 20, 1, 21,
- 5, 6,16427, 46, 32, 41, 62,16426, 3, 3,
- 3, 49, 51,16429, 54, 54, 54,16437,16428, 3,
- 3, 3, 3, 3, 3, 3, 54, 54, 8245, 8235,
- 50, 50, 8234, 3, 3, 50, 3, 3, 50, 3,
- 3, 8237, 10, 10, 54, 10, 40, 39, 8236, 3,
- 10, 54, 10, 54, 37, 37, 54, 37, 3, 31,
- 30, 8, 9, 61, 11, 12, 15, 16, 52, 3,
- 47, 3, 3, 3, 56, 48, 48, 55, 3, 48,
- 3, 3, 48, 3, 29, 29, 54,16427, 28, 28,
-
- 54, 33, 14
- } ;
-
- static const short int yy_accept[516] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 4, 6, 8, 10, 12, 15,
- 19, 21, 23, 25, 27, 29, 31, 33, 36, 39,
- 41, 43, 44, 46, 48, 51, 53, 55, 57, 59,
- 61, 63, 65, 67, 70, 72, 75, 78, 80, 82,
- 85, 87, 90, 92, 95, 98, 98, 98, 99, 99,
- 99, 99, 99, 99, 100, 100, 101, 101, 102, 103,
- 104, 104, 104, 104, 104, 104, 105, 106, 107, 108,
- 108, 108, 109, 110, 111, 111, 111, 111, 111, 111,
-
- 111, 111, 111, 111, 111, 111, 111, 111, 112, 113,
- 114, 114, 114, 115, 115, 116, 117, 117, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 119, 119, 119, 119, 119, 120, 121, 122, 122, 122,
- 123, 123, 123, 123, 124, 125, 126, 127, 128, 128,
- 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
- 129, 129, 129, 129, 129, 129, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 131, 132, 133, 134,
-
- 135, 136, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 138, 139, 139, 139, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 141, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 141, 141, 141, 142, 142,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 144, 144, 144, 144, 144, 144, 145, 147, 148, 150,
- 151, 152, 152, 152, 152, 152, 152, 152, 152, 152,
- 153, 153, 153, 153, 153, 154, 156, 157, 157, 157,
- 158, 158, 159, 159, 159, 159, 159, 159, 159, 159,
-
- 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
- 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
- 160, 160, 160, 160, 160, 160, 160, 160, 160, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 163, 165,
- 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
- 166, 168, 169, 169, 169, 169, 169, 169, 169, 169,
- 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
- 170, 170, 170, 170, 170, 170, 171, 171, 172, 173,
- 174, 174, 174, 175, 175, 175, 175, 175, 175, 175,
- 175, 175, 175, 176, 177, 178, 179, 179, 180, 180,
-
- 180, 180, 180, 181, 181, 181, 182, 182, 182, 182,
- 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
- 182, 182, 182, 182, 183, 184, 185, 185, 185, 185,
- 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
- 186, 186, 186, 186, 186, 187, 187, 188, 188, 188,
- 188, 188, 189, 191, 192, 194, 195, 195, 195, 195,
- 195, 195, 195, 196, 198, 198, 198, 198, 198, 198,
- 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
- 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
- 200, 202, 202, 202, 202, 202, 202, 202, 202, 202,
-
- 202, 202, 202, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 204, 204
- } ;
-
- static const YY_CHAR yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 4, 5, 1, 1, 6, 7, 1, 8, 9,
- 10, 1, 11, 12, 13, 14, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 15, 16, 1,
- 1, 1, 5, 17, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 19, 20, 21, 1, 22, 23, 24, 25, 26, 27,
-
- 28, 29, 30, 31, 32, 33, 33, 34, 35, 36,
- 37, 38, 33, 39, 40, 41, 42, 43, 44, 45,
- 33, 33, 46, 1, 47, 48, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 49, 49, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 49, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 50, 50,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 50, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
- static const YY_CHAR yy_meta[51] =
- { 0,
- 1, 2, 3, 2, 4, 1, 1, 1, 1, 1,
- 1, 4, 1, 4, 1, 1, 5, 6, 1, 4,
- 1, 1, 7, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 9, 10, 4, 4, 11
- } ;
-
- static const short int yy_base[544] =
- { 0,
- 0, 0, 48, 49, 50, 51, 53, 55, 56, 57,
- 0, 0, 1519, 1518, 1517, 1516, 59, 61, 58, 62,
- 67, 79, 1518, 1505, 125, 173, 1508, 65, 72, 1503,
- 98, 103, 71, 217, 76, 110, 119, 1502, 1501, 132,
- 0, 1523, 0, 1523, 1523, 1523, 1484, 0, 1523, 1523,
- 1523, 1523, 1523, 0, 135, 1523, 1523, 1523, 1523, 1523,
- 1523, 0, 143, 1523, 1523, 144, 151, 1523, 62, 144,
- 1497, 135, 147, 1523, 154, 1523, 1500, 1523, 0, 196,
- 199, 263, 256, 1495, 190, 1523, 1523, 1523, 1523, 1491,
- 1490, 1523, 1523, 1523, 200, 252, 123, 258, 264, 256,
-
- 169, 177, 261, 263, 267, 272, 192, 1523, 1523, 304,
- 1472, 1471, 1523, 1464, 0, 0, 1467, 0, 1472, 1471,
- 1470, 1469, 307, 312, 308, 323, 1466, 1469, 1458, 89,
- 1461, 1460, 1471, 1470, 315, 340, 333, 152, 353, 1523,
- 353, 372, 1464, 1523, 229, 1473, 1472, 1471, 162, 376,
- 77, 313, 189, 286, 334, 335, 365, 269, 295, 314,
- 104, 208, 316, 353, 319, 381, 393, 1473, 273, 367,
- 1458, 1457, 1446, 1456, 1443, 1442, 1441, 1440, 357, 1466,
- 396, 403, 397, 416, 1450, 422, 1435, 1446, 1450, 425,
- 429, 1445, 1444, 1437, 1436, 390, 1457, 435, 438, 445,
-
- 442, 1441, 1433, 452, 464, 1439, 410, 1433, 1427, 467,
- 472, 1446, 1445, 370, 476, 1523, 384, 432, 522, 397,
- 571, 437, 462, 447, 465, 466, 418, 469, 470, 474,
- 471, 476, 500, 504, 1523, 510, 1427, 1426, 1418, 1417,
- 1433, 574, 1419, 1418, 1417, 1416, 1426, 1523, 497, 1439,
- 577, 1413, 580, 585, 1421, 1402, 1421, 516, 588, 1523,
- 591, 1405, 1404, 1416, 1415, 1416, 0, 565, 1429, 602,
- 1403, 570, 1402, 1404, 1405, 1401, 1394, 606, 598, 1523,
- 610, 582, 596, 623, 643, 672, 0, 602, 646, 1523,
- 606, 1523, 604, 614, 598, 615, 478, 616, 618, 624,
-
- 634, 637, 678, 718, 767, 1406, 1405, 1391, 1390, 1404,
- 770, 1386, 1386, 1385, 1384, 1383, 1383, 773, 776, 1523,
- 777, 0, 1395, 780, 1381, 1380, 1379, 1378, 1377, 1376,
- 1374, 1380, 1386, 1373, 783, 794, 769, 0, 0, 771,
- 629, 636, 788, 776, 782, 772, 785, 783, 810, 1523,
- 1393, 1383, 1356, 1355, 1342, 1331, 1330, 1328, 1317, 1316,
- 1315, 1311, 1308, 802, 1299, 1317, 1316, 1302, 1298, 1273,
- 1272, 1282, 1269, 833, 839, 1523, 619, 1523, 1291, 1290,
- 786, 793, 1523, 791, 812, 801, 821, 1262, 1258, 1256,
- 1249, 1245, 1523, 1523, 1523, 1523, 846, 1523, 1238, 1234,
-
- 1238, 1227, 852, 1211, 860, 1523, 853, 822, 840, 853,
- 828, 843, 857, 1222, 1220, 853, 1221, 1119, 889, 884,
- 908, 1091, 1090, 1116, 903, 902, 864, 927, 1100, 653,
- 1093, 866, 957, 880, 885, 887, 908, 1085, 1084, 1523,
- 1107, 913, 919, 1095, 1523, 924, 1106, 1006, 997, 923,
- 929, 912, 0, 1009, 1105, 1012, 987, 1079, 1081, 1081,
- 1077, 917, 1523, 1093, 1001, 922, 1000, 1002, 1000, 1041,
- 1068, 1074, 1073, 1063, 995, 1000, 997, 1045, 1010, 1079,
- 1013, 1083, 1084, 990, 992, 925, 912, 920, 863, 1523,
- 872, 1082, 1083, 851, 732, 680, 653, 1084, 539, 469,
-
- 457, 1085, 1523, 415, 254, 1086, 173, 172, 0, 105,
- 22, 0, 0, 1523, 1132, 1143, 1154, 1165, 1176, 1187,
- 1198, 1209, 1220, 1231, 1241, 1252, 1263, 1274, 1285, 1292,
- 1296, 1303, 1314, 1325, 1332, 1339, 1349, 1360, 1371, 1382,
- 1387, 1393, 1401
- } ;
-
- static const short int yy_def[544] =
- { 0,
- 514, 1, 515, 515, 516, 516, 517, 517, 518, 518,
- 519, 519, 520, 520, 521, 521, 522, 522, 523, 523,
- 524, 524, 514, 514, 525, 525, 26, 514, 514, 526,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 527, 514, 528, 514, 514, 514, 514, 529, 514, 514,
- 514, 514, 514, 526, 514, 514, 514, 514, 514, 514,
- 514, 526, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 526, 526,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 530,
- 531, 514, 514, 514, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 531, 531, 531, 531, 514, 514, 532,
- 514, 514, 514, 514, 527, 528, 514, 529, 514, 514,
- 514, 514, 514, 533, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 526, 534, 526, 514, 514, 514,
- 514, 514, 514, 514, 514, 535, 530, 535, 531, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 531, 531, 531, 536, 536, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 533, 533, 514, 514, 514, 514, 514, 514, 514, 537,
- 537, 514, 514, 514, 514, 526, 526, 534, 534, 526,
-
- 526, 526, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 535, 535, 531, 514, 514, 531, 531, 514, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- 531, 531, 536, 536, 514, 536, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 533, 514,
- 533, 514, 514, 514, 514, 514, 514, 537, 537, 514,
- 537, 514, 514, 514, 514, 526, 526, 534, 526, 534,
- 526, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 531, 531, 531, 219, 219, 219, 531, 514, 514,
- 531, 514, 531, 531, 531, 531, 531, 531, 531, 531,
-
- 531, 531, 531, 514, 536, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 538, 514, 537, 514, 514, 514, 514, 526, 514,
- 514, 514, 514, 514, 514, 221, 531, 286, 286, 531,
- 531, 531, 531, 531, 531, 531, 531, 531, 531, 514,
- 535, 531, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 538, 514, 514, 514, 514, 526,
- 514, 514, 514, 514, 514, 514, 531, 514, 531, 531,
- 531, 531, 514, 531, 531, 531, 531, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 539, 514, 514, 514,
-
- 514, 514, 540, 514, 514, 514, 514, 531, 531, 531,
- 531, 531, 531, 514, 514, 541, 514, 514, 539, 514,
- 26, 514, 514, 526, 540, 526, 514, 514, 514, 514,
- 514, 531, 514, 531, 531, 531, 531, 514, 514, 514,
- 514, 514, 514, 514, 514, 539, 514, 539, 421, 514,
- 514, 514, 526, 540, 526, 540, 514, 514, 514, 514,
- 514, 531, 514, 535, 531, 531, 531, 531, 541, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 531, 531,
- 531, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 535, 531, 531, 514, 514, 514, 514, 531, 514, 514,
-
- 514, 531, 514, 514, 514, 531, 514, 514, 542, 421,
- 542, 543, 543, 0, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514
- } ;
-
- static const short int yy_nxt[1574] =
- { 0,
- 24, 25, 26, 27, 28, 29, 30, 24, 24, 24,
- 31, 24, 31, 32, 24, 24, 24, 33, 24, 34,
- 24, 24, 24, 35, 35, 35, 35, 35, 35, 35,
- 35, 35, 35, 36, 35, 35, 35, 35, 35, 35,
- 35, 37, 35, 35, 35, 38, 39, 40, 33, 35,
- 42, 42, 42, 42, 45, 46, 45, 46, 42, 42,
- 59, 53, 60, 53, 59, 54, 60, 54, 512, 53,
- 76, 60, 47, 62, 47, 60, 66, 78, 55, 126,
- 55, 53, 66, 66, 77, 62, 63, 66, 85, 110,
- 190, 191, 190, 148, 42, 42, 42, 42, 63, 81,
-
- 81, 81, 42, 42, 56, 57, 56, 57, 76, 66,
- 126, 82, 64, 65, 66, 217, 84, 83, 514, 85,
- 148, 66, 77, 110, 64, 65, 67, 67, 67, 68,
- 66, 111, 110, 113, 113, 113, 66, 228, 68, 148,
- 112, 87, 69, 66, 70, 123, 123, 123, 130, 87,
- 153, 114, 67, 67, 67, 68, 131, 124, 72, 119,
- 130, 75, 120, 125, 68, 82, 73, 121, 132, 127,
- 122, 203, 74, 69, 67, 67, 67, 68, 148, 74,
- 108, 109, 128, 129, 66, 148, 68, 133, 108, 109,
- 69, 214, 70, 148, 145, 134, 158, 135, 123, 135,
-
- 138, 138, 138, 145, 159, 148, 72, 85, 148, 136,
- 510, 510, 82, 160, 73, 137, 148, 219, 83, 165,
- 74, 69, 86, 87, 148, 88, 89, 149, 150, 151,
- 210, 211, 210, 90, 91, 92, 93, 94, 85, 229,
- 91, 95, 96, 97, 98, 91, 99, 91, 100, 91,
- 91, 101, 102, 103, 91, 104, 105, 106, 91, 107,
- 91, 99, 108, 109, 139, 139, 139, 142, 148, 142,
- 142, 142, 148, 140, 148, 140, 82, 148, 152, 148,
- 148, 508, 141, 148, 97, 148, 110, 154, 148, 143,
- 97, 157, 150, 155, 237, 225, 150, 150, 161, 156,
-
- 150, 162, 148, 164, 163, 166, 167, 166, 179, 179,
- 179, 148, 150, 181, 181, 181, 196, 179, 196, 184,
- 124, 184, 184, 184, 220, 182, 125, 186, 136, 148,
- 148, 183, 148, 185, 137, 148, 186, 169, 226, 230,
- 126, 198, 181, 198, 201, 170, 201, 201, 201, 218,
- 148, 148, 227, 199, 204, 204, 204, 232, 202, 200,
- 221, 222, 222, 140, 205, 140, 205, 205, 205, 148,
- 124, 126, 141, 138, 138, 138, 247, 215, 206, 215,
- 110, 148, 233, 234, 233, 82, 148, 231, 238, 207,
- 223, 83, 148, 208, 236, 167, 236, 249, 249, 249,
-
- 148, 282, 224, 136, 181, 181, 181, 250, 251, 266,
- 251, 251, 251, 148, 250, 183, 182, 179, 179, 179,
- 283, 216, 183, 253, 254, 253, 258, 259, 258, 124,
- 261, 191, 261, 288, 148, 125, 268, 249, 268, 198,
- 181, 198, 507, 196, 179, 196, 269, 274, 148, 269,
- 275, 199, 299, 148, 200, 136, 270, 200, 270, 270,
- 270, 137, 140, 148, 140, 204, 204, 204, 278, 279,
- 278, 272, 284, 281, 140, 281, 140, 215, 148, 215,
- 293, 148, 148, 141, 280, 148, 148, 148, 295, 280,
- 148, 297, 148, 298, 148, 294, 296, 505, 303, 302,
-
- 304, 233, 234, 233, 301, 305, 167, 305, 250, 504,
- 300, 305, 234, 305, 345, 280, 514, 258, 259, 258,
- 280, 216, 285, 285, 285, 285, 285, 285, 285, 285,
- 285, 285, 285, 285, 285, 285, 285, 285, 286, 287,
- 285, 285, 285, 285, 285, 287, 287, 287, 287, 287,
- 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
- 287, 287, 287, 287, 287, 287, 287, 180, 285, 285,
- 285, 285, 289, 290, 289, 311, 269, 311, 249, 249,
- 249, 318, 319, 318, 79, 503, 321, 148, 321, 324,
- 191, 324, 324, 259, 324, 206, 183, 320, 148, 335,
-
- 291, 335, 320, 268, 249, 268, 207, 278, 279, 278,
- 208, 281, 148, 281, 148, 280, 292, 336, 148, 312,
- 148, 200, 148, 280, 81, 81, 81, 280, 320, 297,
- 148, 148, 148, 320, 148, 148, 82, 337, 343, 148,
- 148, 347, 83, 340, 341, 148, 280, 289, 290, 289,
- 148, 346, 148, 148, 280, 342, 344, 408, 280, 285,
- 285, 348, 382, 284, 349, 381, 285, 285, 285, 285,
- 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
- 285, 285, 285, 285, 285, 285, 285, 285, 338, 339,
- 459, 292, 406, 460, 148, 339, 339, 339, 339, 339,
-
- 339, 339, 339, 339, 339, 339, 339, 339, 339, 339,
- 339, 339, 339, 339, 339, 339, 339, 284, 350, 350,
- 501, 350, 350, 350, 350, 350, 350, 350, 350, 350,
- 350, 350, 350, 350, 351, 352, 350, 350, 350, 350,
- 350, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 350, 350, 350, 350, 350, 305, 234,
- 305, 311, 500, 311, 318, 319, 318, 364, 321, 364,
- 321, 324, 259, 324, 335, 148, 335, 148, 148, 383,
- 320, 383, 148, 320, 320, 375, 376, 375, 148, 148,
-
- 280, 148, 148, 364, 148, 364, 379, 148, 380, 148,
- 384, 113, 113, 113, 386, 312, 385, 148, 387, 320,
- 343, 320, 284, 377, 320, 320, 148, 409, 148, 114,
- 410, 280, 412, 383, 405, 405, 405, 148, 148, 378,
- 375, 376, 375, 406, 148, 406, 411, 419, 419, 419,
- 320, 435, 407, 425, 419, 425, 148, 74, 432, 148,
- 413, 427, 427, 427, 428, 420, 428, 428, 428, 148,
- 406, 426, 406, 148, 406, 440, 406, 433, 429, 407,
- 434, 436, 148, 457, 378, 499, 442, 437, 212, 430,
- 446, 446, 446, 431, 443, 448, 148, 448, 448, 448,
-
- 447, 148, 406, 148, 454, 446, 454, 462, 420, 514,
- 514, 514, 514, 456, 455, 456, 456, 456, 465, 514,
- 466, 449, 426, 467, 148, 514, 470, 514, 427, 427,
- 427, 468, 470, 148, 111, 447, 130, 406, 148, 406,
- 112, 450, 130, 514, 472, 133, 407, 497, 219, 451,
- 473, 406, 496, 134, 478, 514, 514, 463, 463, 463,
- 463, 463, 463, 463, 463, 463, 463, 463, 463, 463,
- 463, 463, 463, 464, 91, 463, 463, 463, 463, 463,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
-
- 91, 91, 463, 463, 463, 463, 463, 446, 446, 446,
- 514, 418, 429, 454, 446, 454, 148, 148, 148, 495,
- 455, 494, 514, 430, 489, 420, 148, 431, 79, 148,
- 72, 426, 479, 482, 488, 480, 487, 492, 73, 481,
- 150, 483, 166, 167, 166, 490, 490, 490, 490, 490,
- 490, 490, 490, 490, 490, 490, 490, 490, 490, 490,
- 490, 491, 91, 490, 490, 490, 490, 490, 91, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
- 490, 490, 490, 490, 490, 148, 470, 470, 148, 148,
-
- 148, 148, 148, 406, 237, 238, 486, 485, 484, 212,
- 498, 477, 476, 493, 475, 474, 453, 445, 471, 502,
- 470, 150, 469, 469, 461, 506, 458, 453, 452, 452,
- 445, 509, 41, 41, 41, 41, 41, 41, 41, 41,
- 41, 41, 41, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 51, 51,
-
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 52,
- 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 61, 61, 61, 61, 61, 61, 61, 61, 61,
- 61, 61, 71, 71, 71, 444, 71, 439, 71, 438,
- 140, 71, 79, 79, 423, 79, 79, 79, 79, 79,
- 79, 79, 79, 115, 115, 422, 115, 115, 115, 115,
- 115, 115, 421, 115, 116, 116, 421, 116, 116, 116,
- 116, 116, 116, 417, 116, 118, 118, 416, 118, 118,
- 118, 118, 118, 118, 416, 118, 147, 147, 415, 147,
-
- 91, 91, 414, 91, 168, 168, 148, 148, 140, 404,
- 168, 140, 403, 168, 180, 180, 180, 180, 180, 180,
- 180, 180, 180, 180, 180, 197, 197, 197, 197, 197,
- 197, 197, 197, 197, 197, 197, 213, 213, 402, 213,
- 235, 235, 401, 400, 399, 398, 235, 397, 396, 235,
- 260, 260, 395, 394, 393, 392, 260, 74, 391, 260,
- 365, 365, 365, 365, 365, 365, 365, 365, 365, 390,
- 365, 418, 418, 418, 418, 418, 418, 418, 418, 418,
- 418, 418, 424, 424, 424, 424, 424, 424, 424, 424,
- 424, 424, 424, 441, 441, 389, 388, 441, 511, 148,
-
- 511, 513, 513, 513, 513, 513, 513, 513, 513, 212,
- 513, 513, 374, 373, 372, 371, 140, 370, 369, 368,
- 367, 366, 74, 363, 362, 361, 360, 359, 358, 357,
- 356, 355, 354, 353, 334, 333, 332, 331, 330, 329,
- 267, 202, 328, 327, 326, 325, 323, 322, 256, 317,
- 248, 185, 316, 315, 314, 313, 310, 309, 308, 307,
- 306, 212, 212, 277, 276, 273, 143, 271, 267, 265,
- 264, 263, 262, 257, 256, 255, 252, 248, 246, 245,
- 244, 243, 242, 241, 240, 239, 110, 212, 146, 212,
- 209, 195, 194, 193, 192, 189, 188, 187, 178, 177,
-
- 176, 175, 174, 173, 172, 171, 148, 146, 144, 76,
- 130, 117, 66, 66, 80, 75, 66, 514, 42, 42,
- 50, 50, 23, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514
- } ;
-
- static const short int yy_chk[1574] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 3, 4, 5, 6, 7, 7, 8, 8, 9, 10,
- 19, 17, 19, 18, 20, 17, 20, 18, 511, 21,
- 28, 19, 7, 21, 8, 20, 28, 29, 17, 69,
- 18, 22, 33, 29, 28, 22, 21, 35, 33, 35,
- 130, 130, 130, 151, 3, 4, 5, 6, 22, 31,
-
- 31, 31, 9, 10, 17, 17, 18, 18, 32, 31,
- 69, 31, 21, 21, 32, 151, 32, 31, 510, 33,
- 161, 36, 32, 36, 22, 22, 25, 25, 25, 25,
- 37, 36, 37, 40, 40, 40, 25, 161, 25, 97,
- 37, 55, 25, 40, 25, 66, 66, 66, 72, 63,
- 97, 40, 67, 67, 67, 67, 72, 66, 25, 55,
- 73, 75, 55, 66, 67, 138, 25, 63, 73, 70,
- 63, 138, 25, 25, 26, 26, 26, 26, 149, 40,
- 55, 55, 70, 70, 26, 101, 26, 75, 63, 63,
- 26, 149, 26, 102, 85, 75, 101, 80, 80, 80,
-
- 81, 81, 81, 85, 102, 153, 26, 85, 107, 80,
- 508, 507, 81, 102, 26, 80, 95, 153, 81, 107,
- 26, 26, 34, 34, 162, 34, 34, 95, 95, 95,
- 145, 145, 145, 34, 34, 34, 34, 34, 85, 162,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
- 34, 34, 34, 34, 82, 82, 82, 83, 96, 83,
- 83, 83, 100, 82, 98, 82, 82, 103, 96, 104,
- 99, 505, 82, 105, 98, 158, 169, 98, 106, 83,
- 99, 100, 98, 98, 169, 158, 100, 104, 103, 99,
-
- 105, 103, 154, 106, 105, 110, 110, 110, 123, 123,
- 123, 159, 106, 124, 124, 124, 135, 135, 135, 125,
- 123, 125, 125, 125, 154, 124, 123, 126, 135, 152,
- 160, 124, 163, 125, 135, 165, 126, 110, 159, 163,
- 126, 136, 136, 136, 137, 110, 137, 137, 137, 152,
- 155, 156, 160, 136, 139, 139, 139, 165, 137, 136,
- 155, 155, 156, 139, 141, 139, 141, 141, 141, 164,
- 179, 126, 139, 142, 142, 142, 179, 150, 141, 150,
- 170, 157, 166, 166, 166, 142, 214, 164, 170, 141,
- 157, 142, 150, 141, 167, 167, 167, 181, 181, 181,
-
- 217, 214, 157, 196, 182, 182, 182, 181, 183, 196,
- 183, 183, 183, 220, 182, 181, 182, 184, 184, 184,
- 217, 150, 182, 186, 186, 186, 190, 190, 190, 184,
- 191, 191, 191, 220, 227, 184, 198, 198, 198, 199,
- 199, 199, 504, 201, 201, 201, 198, 207, 218, 199,
- 207, 199, 227, 222, 198, 201, 200, 199, 200, 200,
- 200, 201, 204, 224, 204, 205, 205, 205, 210, 210,
- 210, 204, 218, 211, 205, 211, 205, 215, 223, 215,
- 222, 225, 226, 205, 210, 228, 229, 231, 224, 211,
- 230, 226, 232, 226, 297, 223, 225, 501, 231, 230,
-
- 232, 233, 233, 233, 229, 234, 234, 234, 249, 500,
- 228, 236, 236, 236, 297, 210, 249, 258, 258, 258,
- 211, 215, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 219, 219, 219, 219, 219, 219, 268, 219, 219,
- 219, 219, 221, 221, 221, 242, 268, 242, 251, 251,
- 251, 253, 253, 253, 268, 499, 254, 221, 254, 259,
- 259, 259, 261, 261, 261, 272, 251, 253, 282, 279,
-
- 221, 279, 254, 270, 270, 270, 272, 278, 278, 278,
- 272, 281, 283, 281, 295, 279, 221, 282, 288, 242,
- 293, 270, 291, 278, 284, 284, 284, 281, 253, 293,
- 294, 296, 298, 254, 299, 377, 284, 283, 295, 284,
- 300, 299, 284, 288, 291, 341, 279, 289, 289, 289,
- 301, 298, 342, 302, 278, 294, 296, 377, 281, 285,
- 285, 301, 342, 300, 302, 341, 285, 285, 285, 285,
- 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
- 285, 285, 285, 285, 285, 285, 285, 285, 286, 286,
- 430, 289, 497, 430, 303, 286, 286, 286, 286, 286,
-
- 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 286, 286, 286, 303, 304, 304,
- 496, 304, 304, 304, 304, 304, 304, 304, 304, 304,
- 304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
- 304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
- 304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
- 304, 304, 304, 304, 304, 304, 304, 304, 305, 305,
- 305, 311, 495, 311, 318, 318, 318, 319, 321, 319,
- 321, 324, 324, 324, 335, 337, 335, 340, 346, 343,
- 318, 343, 344, 319, 321, 336, 336, 336, 345, 348,
-
- 335, 347, 381, 364, 343, 364, 337, 384, 340, 382,
- 344, 349, 349, 349, 346, 311, 345, 386, 347, 364,
- 382, 318, 348, 336, 319, 321, 349, 381, 385, 349,
- 384, 335, 386, 343, 374, 374, 374, 387, 408, 336,
- 375, 375, 375, 374, 411, 374, 385, 397, 397, 397,
- 364, 411, 374, 403, 403, 403, 409, 349, 408, 412,
- 387, 405, 405, 405, 407, 397, 407, 407, 407, 410,
- 405, 403, 405, 413, 427, 416, 427, 409, 407, 405,
- 410, 412, 432, 427, 375, 494, 416, 413, 491, 407,
- 419, 419, 419, 407, 416, 420, 434, 420, 420, 420,
-
- 419, 435, 489, 436, 425, 425, 425, 432, 419, 421,
- 421, 421, 421, 426, 425, 426, 426, 426, 434, 421,
- 435, 421, 425, 436, 437, 421, 442, 421, 428, 428,
- 428, 437, 443, 462, 442, 446, 450, 428, 466, 428,
- 443, 421, 451, 446, 450, 452, 428, 488, 466, 421,
- 451, 487, 486, 452, 462, 421, 421, 433, 433, 433,
- 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
- 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
- 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
- 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
-
- 433, 433, 433, 433, 433, 433, 433, 448, 448, 448,
- 449, 454, 457, 456, 456, 456, 467, 465, 468, 485,
- 454, 484, 469, 457, 477, 448, 479, 457, 454, 481,
- 449, 456, 465, 469, 476, 467, 475, 479, 449, 468,
- 481, 469, 470, 470, 470, 478, 478, 478, 478, 478,
- 478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
- 478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
- 478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
- 478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
- 478, 478, 478, 478, 478, 480, 482, 483, 492, 493,
-
- 498, 502, 506, 474, 482, 483, 473, 472, 471, 464,
- 493, 461, 460, 480, 459, 458, 455, 447, 444, 498,
- 441, 492, 439, 438, 431, 502, 429, 424, 423, 422,
- 418, 506, 515, 515, 515, 515, 515, 515, 515, 515,
- 515, 515, 515, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 517, 517, 517, 517, 517, 517,
- 517, 517, 517, 517, 517, 518, 518, 518, 518, 518,
- 518, 518, 518, 518, 518, 518, 519, 519, 519, 519,
- 519, 519, 519, 519, 519, 519, 519, 520, 520, 520,
- 520, 520, 520, 520, 520, 520, 520, 520, 521, 521,
-
- 521, 521, 521, 521, 521, 521, 521, 521, 521, 522,
- 522, 522, 522, 522, 522, 522, 522, 522, 522, 522,
- 523, 523, 523, 523, 523, 523, 523, 523, 523, 523,
- 523, 524, 524, 524, 524, 524, 524, 524, 524, 524,
- 524, 524, 525, 525, 525, 417, 525, 415, 525, 414,
- 404, 525, 526, 526, 402, 526, 526, 526, 526, 526,
- 526, 526, 526, 527, 527, 401, 527, 527, 527, 527,
- 527, 527, 400, 527, 528, 528, 399, 528, 528, 528,
- 528, 528, 528, 392, 528, 529, 529, 391, 529, 529,
- 529, 529, 529, 529, 390, 529, 530, 530, 389, 530,
-
- 531, 531, 388, 531, 532, 532, 380, 379, 373, 372,
- 532, 371, 370, 532, 533, 533, 533, 533, 533, 533,
- 533, 533, 533, 533, 533, 534, 534, 534, 534, 534,
- 534, 534, 534, 534, 534, 534, 535, 535, 369, 535,
- 536, 536, 368, 367, 366, 365, 536, 363, 362, 536,
- 537, 537, 361, 360, 359, 358, 537, 357, 356, 537,
- 538, 538, 538, 538, 538, 538, 538, 538, 538, 355,
- 538, 539, 539, 539, 539, 539, 539, 539, 539, 539,
- 539, 539, 540, 540, 540, 540, 540, 540, 540, 540,
- 540, 540, 540, 541, 541, 354, 353, 541, 542, 352,
-
- 542, 543, 543, 543, 543, 543, 543, 543, 543, 351,
- 543, 543, 334, 333, 332, 331, 330, 329, 328, 327,
- 326, 325, 323, 317, 316, 315, 314, 313, 312, 310,
- 309, 308, 307, 306, 277, 276, 275, 274, 273, 271,
- 269, 266, 265, 264, 263, 262, 257, 256, 255, 252,
- 250, 247, 246, 245, 244, 243, 241, 240, 239, 238,
- 237, 213, 212, 209, 208, 206, 203, 202, 197, 195,
- 194, 193, 192, 189, 188, 187, 185, 180, 178, 177,
- 176, 175, 174, 173, 172, 171, 168, 148, 147, 146,
- 143, 134, 133, 132, 131, 129, 128, 127, 122, 121,
-
- 120, 119, 117, 114, 112, 111, 91, 90, 84, 77,
- 71, 47, 39, 38, 30, 27, 24, 23, 16, 15,
- 14, 13, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514, 514, 514, 514, 514, 514, 514, 514,
- 514, 514, 514
- } ;
-
- static yy_state_type yy_last_accepting_state;
- static YY_CHAR *yy_last_accepting_cpos;
-
- static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
- static YY_CHAR *yy_full_match;
- static int yy_lp;
- static int yy_looking_for_trail_begin = 0;
- static int yy_full_lp;
- static int *yy_full_state;
- #define YY_TRAILING_MASK 0x2000
- #define YY_TRAILING_HEAD_MASK 0x4000
- #define REJECT \
- { \
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
- yy_cp = yy_full_match; /* restore poss. backed-over text */ \
- yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
- yy_state_ptr = yy_full_state; /* restore orig. state */ \
- yy_current_state = *yy_state_ptr; /* restore curr. state */ \
- ++yy_lp; \
- goto find_rule; \
- }
- #define yymore() yymore_used_but_not_detected
- #define YY_MORE_ADJ 0
-
- /* these variables are all declared out here so that section 3 code can
- * manipulate them
- */
- /* points to current character in buffer */
- static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
- static int yy_init = 1; /* whether we need to initialize */
- static int yy_start = 0; /* start state number */
-
- /* flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
- static int yy_did_buffer_switch_on_eof;
-
- static yy_state_type yy_get_previous_state YY_PROTO(( void ));
- static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
- static int yy_get_next_buffer YY_PROTO(( void ));
- static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
- void yyrestart YY_PROTO(( FILE *input_file ));
- void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
- void yy_load_buffer_state YY_PROTO(( void ));
- YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
- void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
- void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-
- #define yy_new_buffer yy_create_buffer
-
- #ifdef __cplusplus
- static int yyinput YY_PROTO(( void ));
- #else
- static int input YY_PROTO(( void ));
- #endif
-
- YY_DECL
- {
- register yy_state_type yy_current_state;
- register YY_CHAR *yy_cp, *yy_bp;
- register int yy_act;
-
-
-
-
- if ( yy_init )
- {
- YY_USER_INIT;
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( yy_current_buffer )
- yy_init_buffer( yy_current_buffer, yyin );
- else
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
-
- yy_init = 0;
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* support of yytext */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of the
- * current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
- yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[*yy_cp];
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = yy_def[yy_current_state];
- if ( yy_current_state >= 515 )
- yy_c = yy_meta[yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- *yy_state_ptr++ = yy_current_state;
- ++yy_cp;
- }
- while ( yy_current_state != 514 );
-
- yy_find_action:
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- find_rule: /* we branch to this label when backtracking */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[yy_lp];
- if ( yy_act & YY_TRAILING_HEAD_MASK ||
- yy_looking_for_trail_begin )
- {
- if ( yy_act == yy_looking_for_trail_begin )
- {
- yy_looking_for_trail_begin = 0;
- yy_act &= ~YY_TRAILING_HEAD_MASK;
- break;
- }
- }
- else if ( yy_act & YY_TRAILING_MASK )
- {
- yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
- yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
- }
- else
- {
- yy_full_match = yy_cp;
- yy_full_state = yy_state_ptr;
- yy_full_lp = yy_lp;
- break;
- }
- ++yy_lp;
- goto find_rule;
- }
- --yy_cp;
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
- YY_USER_ACTION;
-
- do_action: /* this label is used only to access EOF actions */
-
-
- switch ( yy_act )
- {
- case 1:
- # line 146 "lacheck.lex"
- { ; }
- YY_BREAK
- case 2:
- # line 148 "lacheck.lex"
- { ; }
- YY_BREAK
- case 3:
- # line 150 "lacheck.lex"
- { ; }
- YY_BREAK
- case 4:
- # line 152 "lacheck.lex"
- { line_count++; }
- YY_BREAK
- case 5:
- # line 154 "lacheck.lex"
- { ; }
- YY_BREAK
- case 6:
- # line 156 "lacheck.lex"
- { ; }
- YY_BREAK
- case 7:
- # line 158 "lacheck.lex"
- { ; }
- YY_BREAK
- case 8:
- # line 160 "lacheck.lex"
- { push( "{", 0, line_count);}
- YY_BREAK
- case 9:
- # line 162 "lacheck.lex"
- { g_checkend(0); }
- YY_BREAK
- case 10:
- # line 164 "lacheck.lex"
- BEGIN(DEF);
- YY_BREAK
- case 11:
- # line 167 "lacheck.lex"
- { ++def_count; }
- YY_BREAK
- case 12:
- # line 169 "lacheck.lex"
- { --def_count;
- if(def_count == 0)
- BEGIN(INITIAL); }
- YY_BREAK
- case 13:
- # line 173 "lacheck.lex"
- { ; }
- YY_BREAK
- case 14:
- # line 175 "lacheck.lex"
- BEGIN(ENV_DEF);
- YY_BREAK
- case 15:
- # line 177 "lacheck.lex"
- { ++def_count; }
- YY_BREAK
- case 16:
- # line 179 "lacheck.lex"
- { --def_count;
- if(def_count == 0)
- BEGIN(DEF); }
- YY_BREAK
- case 17:
- # line 183 "lacheck.lex"
- { ; }
- YY_BREAK
- case 18:
- # line 185 "lacheck.lex"
- {
- if(CG_TYPE == 4 || CG_TYPE == 5)
- print_bad_match(yytext,4);
- else
- {
- push( yytext, 4, line_count);
- }}
- YY_BREAK
- case 19:
- # line 193 "lacheck.lex"
- { g_checkend(4); }
- YY_BREAK
- case 20:
- # line 195 "lacheck.lex"
- {
- if(CG_TYPE == 4 || CG_TYPE == 5)
- print_bad_match(yytext,5);
- else
- {
- push( yytext, 5, line_count);
- }}
- YY_BREAK
- case 21:
- # line 204 "lacheck.lex"
- { g_checkend(5); BEGIN(AFTER_DISPLAY);}
- YY_BREAK
- case 22:
- # line 206 "lacheck.lex"
- {
-
- printf( "\"%s\", line %d: puctation mark \"%s\" should be placed before end of displaymath\n",
- file_name, line_count, yytext);
- ++warn_count ;
-
- BEGIN(INITIAL); }
- YY_BREAK
- case 23:
- # line 214 "lacheck.lex"
- { BEGIN(INITIAL); }
- YY_BREAK
- case 24:
- # line 216 "lacheck.lex"
- { ++line_count;
- BEGIN(INITIAL); }
- YY_BREAK
- case 25:
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
- yy_c_buf_p = yy_cp = yy_bp + 1;
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- # line 219 "lacheck.lex"
- { if (CG_TYPE == 4)
- {
- printf( "\"%s\", line %d: puctation mark \"%s\" should be placed after end of math mode\n",
- file_name, line_count, yytext);
- ++warn_count ;
- }}
- YY_BREAK
- case 26:
- # line 226 "lacheck.lex"
- {
-
- if(CG_TYPE == 5)
- print_bad_match(yytext, 4);
- else
-
- if(CG_TYPE == 4)
- {
- e_checkend(4, yytext);
- }
- else
- {
- push( yytext, 4, line_count);
- }}
- YY_BREAK
- case 27:
- # line 242 "lacheck.lex"
- {
-
- if(CG_TYPE == 4)
- print_bad_match(yytext,5);
- else
-
- if(CG_TYPE == 5)
- {
- e_checkend(5, yytext);
- BEGIN(AFTER_DISPLAY);
- }
- else
- {
- push( yytext, 5, line_count);
- }}
- YY_BREAK
- case 28:
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
- yy_c_buf_p = yy_cp = yy_bp + 11;
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- # line 258 "lacheck.lex"
- {
- {
- push((unsigned char *)"\\begingroup", 1, line_count);
- }}
- YY_BREAK
- case 29:
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
- yy_c_buf_p = yy_cp = yy_bp + 9;
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- # line 264 "lacheck.lex"
- {
- {
- g_checkend(1);
- }}
- YY_BREAK
- case 30:
- # line 270 "lacheck.lex"
- { BEGIN(B_ENVIRONMENT); }
- YY_BREAK
- case 31:
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
- yy_c_buf_p = yy_cp -= 1;
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- # line 272 "lacheck.lex"
- {
- {
-
- printf("\"%s\", line %i: {argument} missing for \\begin\n",
- file_name, line_count) ;
- ++warn_count;
- }}
- YY_BREAK
- case 32:
- # line 280 "lacheck.lex"
- {
- {
- if (strcmp( yytext, "verbatim" ) == 0 )
- {
- input();
- BEGIN(VERBATIM);
- }
- else
- {
- push(yytext, 2, line_count);
- input();
- BEGIN(INITIAL);
- }
- }}
- YY_BREAK
- case 33:
- # line 295 "lacheck.lex"
- { BEGIN(INITIAL); }
- YY_BREAK
- case 34:
- # line 297 "lacheck.lex"
- {
- printf("\"%s\", line %i: TAB character in verbatim environment\n",
- file_name, line_count) ;
- ++warn_count;
- }
- YY_BREAK
- case 35:
- # line 303 "lacheck.lex"
- { ; }
- YY_BREAK
- case 36:
- # line 305 "lacheck.lex"
- { ++line_count; }
- YY_BREAK
- case 37:
- # line 308 "lacheck.lex"
- {
- sscanf (yytext, "\\verb%c", &verb_char );
- BEGIN(VERB);
- }
- YY_BREAK
- case 38:
- # line 313 "lacheck.lex"
- {
- if ( *yytext == (unsigned char)verb_char )
- BEGIN(INITIAL);
- if ( *yytext == '\n' )
- ++line_count;
- }
- YY_BREAK
- case 39:
- # line 321 "lacheck.lex"
- { BEGIN(E_ENVIRONMENT); }
- YY_BREAK
- case 40:
- *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
- yy_c_buf_p = yy_cp -= 1;
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- # line 323 "lacheck.lex"
- {
- {
- printf("\"%s\", line %i: {argument} missing for \\end\n",
- file_name, line_count) ;
- ++warn_count;
- }}
- YY_BREAK
- case 41:
- # line 331 "lacheck.lex"
- {
- {
- e_checkend(2, yytext);
- input();
-
- BEGIN(INITIAL);
- }}
- YY_BREAK
- case 42:
- # line 340 "lacheck.lex"
- {
- {
- if ( *yytext == '\n' )
- ++line_count;
-
- printf( "\"%s\", line %d: missing `\\ ' after \"%s\"\n",
- file_name, line_count, ++yytext);
- ++warn_count ;
- }}
- YY_BREAK
- case 43:
- # line 350 "lacheck.lex"
- {
- {
- printf( "\"%s\", line %d: missing `\\ ' after \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count ;
- }}
- YY_BREAK
- case 44:
- # line 357 "lacheck.lex"
- {
- {
- if ( *yytext == '\n' )
- ++line_count;
- printf("\"%s\", line %d: missing `\\@' before punctation mark in \"%s\"\n",
- file_name, line_count, ++yytext);
- ++warn_count ;
- }}
- YY_BREAK
- case 45:
- # line 366 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: missing `\\@' before `.' in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count ;
- }}
- YY_BREAK
- case 46:
- # line 373 "lacheck.lex"
- {
-
- printf("\"%s\", line %d: double space at \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 47:
- # line 380 "lacheck.lex"
- {
- printf("\"%s\", line %d: \\ldots should be \\cdots in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 48:
- # line 386 "lacheck.lex"
- {
- printf("\"%s\", line %d: \\cdots should be \\ldots in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 49:
- # line 392 "lacheck.lex"
- {
- printf("\"%s\", line %d: Dots should be \\cdots in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 50:
- # line 398 "lacheck.lex"
- {
- printf("\"%s\", line %d: Dots should be \\ldots in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 51:
- # line 405 "lacheck.lex"
- {
- printf("\"%s\", line %d: Dots should be ellipsis \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }
- YY_BREAK
- case 52:
- # line 411 "lacheck.lex"
- {
-
- printf("\"%s\", line %d: perhaps you should insert a `~' before \"%s\"\n",
- file_name, line_count, ++yytext);
- }
- YY_BREAK
- /*
- {primitive}/[^a-zA-Z] {
- {
- printf("\"%s\", line %d: Don't use \"%s\" in LaTeX documents\n",
- file_name, line_count, yytext);
- ++warn_count ;
- }}
- */
- case 53:
- # line 427 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: Fontspecifiers don't take arguments. \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- /* (void) input(); */
- }}
- YY_BREAK
- case 54:
- # line 436 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: Do not use @ in LaTeX macro names. \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }}
- YY_BREAK
- case 55:
- # line 443 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: Use ` to begin quotation, not ' \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }}
- YY_BREAK
- case 56:
- # line 450 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: Use ' to end quotation, not ` \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }}
- YY_BREAK
- case 57:
- # line 458 "lacheck.lex"
- {
- {
- printf("\"%s\", line %d: Whitespace before punctation mark in \"%s\"\n",
- file_name, line_count, yytext);
- ++warn_count;
- }}
- YY_BREAK
- case 58:
- # line 466 "lacheck.lex"
- { BEGIN(COMMENT); }
- YY_BREAK
- case 59:
- # line 468 "lacheck.lex"
- { BEGIN(INITIAL); ++line_count; }
- YY_BREAK
- case 60:
- # line 470 "lacheck.lex"
- { ; }
- YY_BREAK
- case 61:
- # line 473 "lacheck.lex"
- { BEGIN(INCLUDE); }
- YY_BREAK
- case 62:
- # line 475 "lacheck.lex"
- {
- {
- if ( strstr(yytext,".sty") == NULL )
- {
- input_file(yytext);
- }
- else
- {
- printf("\"%s\", line %d: Style file `%s\' omitted.\n",
- file_name,
- line_count,
- yytext);
- input();
- }
- BEGIN(INITIAL);
- }}
- YY_BREAK
- case YY_STATE_EOF(INITIAL):
- case YY_STATE_EOF(B_ENVIRONMENT):
- case YY_STATE_EOF(E_ENVIRONMENT):
- case YY_STATE_EOF(VERBATIM):
- case YY_STATE_EOF(INCLUDE):
- case YY_STATE_EOF(MATH):
- case YY_STATE_EOF(COMMENT):
- case YY_STATE_EOF(VERB):
- case YY_STATE_EOF(DEF):
- case YY_STATE_EOF(AFTER_DISPLAY):
- case YY_STATE_EOF(ENV_DEF):
- # line 492 "lacheck.lex"
- {
- if (--istackp < 0)
- yyterminate();
-
- else
- {
- fclose(yyin);
- f_checkend(file_name);
- yy_switch_to_buffer(istack[istackp].stream);
- free(file_name);
- line_count = istack[istackp].linenum;
- file_name = istack[istackp].name;
- input();
- BEGIN(INITIAL);
- }
-
- }
- YY_BREAK
- case 64:
- # line 511 "lacheck.lex"
- { ; }
- YY_BREAK
- case 65:
- # line 512 "lacheck.lex"
- ECHO;
- YY_BREAK
-
- case YY_END_OF_BUFFER:
- {
- /* amount of text matched not including the EOB char */
- int yy_amount_of_matched_text = yy_cp - yytext - 1;
-
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
-
- /* note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the end-
- * of-buffer state). Contrast this with the test in yyinput().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* this was really a NUL */
- {
- yy_state_type yy_next_state;
-
- yy_c_buf_p = yytext + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* okay, we're now positioned to make the
- * NUL transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we
- * don't want to build jamming into it because
- * then it will run more slowly)
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = yytext + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* consume the NUL */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* note: because we've taken care in
- * yy_get_next_buffer() to have set up yytext,
- * we can now set up yy_c_buf_p so that if some
- * total hoser (like flex itself) wants
- * to call the scanner after we return the
- * YY_NULL, it'll still work - another YY_NULL
- * will get returned.
- */
- yy_c_buf_p = yytext + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF((yy_start - 1) / 2);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- }
- break;
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- #ifdef FLEX_DEBUG
- printf( "action # %d\n", yy_act );
- #endif
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- }
- }
- }
-
-
- /* yy_get_next_buffer - try to read in a new buffer
- *
- * synopsis
- * int yy_get_next_buffer();
- *
- * returns a code representing an action
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
- static int yy_get_next_buffer()
-
- {
- register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
- register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- /* try to read more data */
-
- /* first move last chars to start of buffer */
- number_to_move = yy_c_buf_p - yytext;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_n_chars = 0;
-
- else
- {
- int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- else if ( num_to_read <= 0 )
- YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
-
- /* read in more data */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == 1 )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yy_current_buffer->yy_eof_status = EOF_DONE;
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_eof_status = EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- /* yytext begins at the second character in yy_ch_buf; the first
- * character is the one which preceded it before reading in the latest
- * buffer; it needs to be kept around in case it's a newline, so
- * yy_get_previous_state() will have with '^' rules active
- */
-
- yytext = &yy_current_buffer->yy_ch_buf[1];
-
- return ( ret_val );
- }
-
-
- /* yy_get_previous_state - get the state just before the EOB char was reached
- *
- * synopsis
- * yy_state_type yy_get_previous_state();
- */
-
- static yy_state_type yy_get_previous_state()
-
- {
- register yy_state_type yy_current_state;
- register YY_CHAR *yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-
- for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = yy_def[yy_current_state];
- if ( yy_current_state >= 515 )
- yy_c = yy_meta[yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- *yy_state_ptr++ = yy_current_state;
- }
-
- return ( yy_current_state );
- }
-
-
- /* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
- #ifdef YY_USE_PROTOS
- static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
- #else
- static yy_state_type yy_try_NUL_trans( yy_current_state )
- register yy_state_type yy_current_state;
- #endif
-
- {
- register int yy_is_jam;
-
- register YY_CHAR yy_c = 1;
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = yy_def[yy_current_state];
- if ( yy_current_state >= 515 )
- yy_c = yy_meta[yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- *yy_state_ptr++ = yy_current_state;
- yy_is_jam = (yy_current_state == 514);
-
- return ( yy_is_jam ? 0 : yy_current_state );
- }
-
-
- #ifdef YY_USE_PROTOS
- static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
- #else
- static void yyunput( c, yy_bp )
- YY_CHAR c;
- register YY_CHAR *yy_bp;
- #endif
-
- {
- register YY_CHAR *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
- register YY_CHAR *dest =
- &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
- register YY_CHAR *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += dest - source;
- yy_bp += dest - source;
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
- yy_cp[-2] = '\n';
-
- *--yy_cp = c;
-
- /* note: the formal parameter *must* be called "yy_bp" for this
- * macro to now work correctly
- */
- YY_DO_BEFORE_ACTION; /* set up yytext again */
- }
-
-
- #ifdef __cplusplus
- static int yyinput()
- #else
- static int input()
- #endif
-
- {
- int c;
- YY_CHAR *yy_cp = yy_c_buf_p;
-
- *yy_cp = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* this was really a NUL */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- yytext = yy_c_buf_p;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- {
- yy_c_buf_p = yytext + YY_MORE_ADJ;
- return ( EOF );
- }
-
- YY_NEW_FILE;
-
- #ifdef __cplusplus
- return ( yyinput() );
- #else
- return ( input() );
- #endif
- }
- break;
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext + YY_MORE_ADJ;
- break;
-
- case EOB_ACT_LAST_MATCH:
- #ifdef __cplusplus
- YY_FATAL_ERROR( "unexpected last match in yyinput()" );
- #else
- YY_FATAL_ERROR( "unexpected last match in input()" );
- #endif
- }
- }
- }
-
- c = *yy_c_buf_p;
- yy_hold_char = *++yy_c_buf_p;
-
- return ( c );
- }
-
-
- #ifdef YY_USE_PROTOS
- void yyrestart( FILE *input_file )
- #else
- void yyrestart( input_file )
- FILE *input_file;
- #endif
-
- {
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
- #ifdef YY_USE_PROTOS
- void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
- #else
- void yy_switch_to_buffer( new_buffer )
- YY_BUFFER_STATE new_buffer;
- #endif
-
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* flush out information for old buffer */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* we don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
- #ifdef YY_USE_PROTOS
- void yy_load_buffer_state( void )
- #else
- void yy_load_buffer_state()
- #endif
-
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
- #ifdef YY_USE_PROTOS
- YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
- #else
- YY_BUFFER_STATE yy_create_buffer( file, size )
- FILE *file;
- int size;
- #endif
-
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
-
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- yy_init_buffer( b, file );
-
- return ( b );
- }
-
-
- #ifdef YY_USE_PROTOS
- void yy_delete_buffer( YY_BUFFER_STATE b )
- #else
- void yy_delete_buffer( b )
- YY_BUFFER_STATE b;
- #endif
-
- {
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- free( (char *) b->yy_ch_buf );
- free( (char *) b );
- }
-
-
- #ifdef YY_USE_PROTOS
- void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
- #else
- void yy_init_buffer( b, file )
- YY_BUFFER_STATE b;
- FILE *file;
- #endif
-
- {
- b->yy_input_file = file;
-
- /* we put in the '\n' and start reading from [1] so that an
- * initial match-at-newline will be true.
- */
-
- b->yy_ch_buf[0] = '\n';
- b->yy_n_chars = 1;
-
- /* we always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[1];
-
- b->yy_eof_status = EOF_NOT_SEEN;
- }
- # line 512 "lacheck.lex"
-
- int main( argc, argv )
- int argc;
- char *argv[];
- {
- /* allocate initial stacks */
- gstack = (tex_group *)malloc(gstack_size * sizeof(tex_group));
- istack = (input_ *)malloc(istack_size * sizeof(input_));
- if ( gstack == NULL || istack == NULL ) {
- fprintf(stderr, "%s: not enough memory for stacks\n", PROGNAME);
- exit(3);
- }
-
- if(argc > 1)
- {
- if ( (file_name = malloc(strlen(argv[1]) + 5)) == NULL ) {
- fprintf(stderr, "%s: out of memory\n", PROGNAME);
- exit(3);
- }
-
- strcpy(file_name, argv[1]);
-
- if ((yyin = fopen( file_name, "r")) != NULL )
- {
- push(file_name, 3, 1);
- yylex();
- f_checkend(file_name);
- }
- else {
- strcat(file_name, ".tex" );
- if ((yyin = fopen( file_name, "r")) != NULL )
- {
- push(file_name, 3, 1);
- yylex();
- f_checkend(file_name);
- }
- else
- fprintf(stderr,
- "%s: Could not open : %s\n",PROGNAME, argv[1]);
- }
- }
- else
- {
- printf("\n* %s *\n\n",PROGNAME);
- printf("\t...a consistency checker for LaTeX documents.\n\n");
-
- printf("Usage:\n\tlacheck filename[.tex] <return>\n\n\n");
-
- printf("\tFrom within Emacs:\n\n\t");
- printf("M-x compile <return>\n\tlacheck filename[.tex] <return>");
- printf("\n\n\tUse C-x ` to step through the messages.\n\n");
- printf("\n\tThe found context is displayed in \"double quotes\"\n\n");
- printf("Remark:\n\tAll messages are only warnings!\n\n");
- printf("\tYour document may be right though LaCheck tells\n");
- printf("\tsomething else.\n\n");
- }
- return(0);
- }
-
- #ifdef NEED_STRSTR
- char *
- strstr(string, substring)
- register char *string; /* String to search. */
- char *substring; /* Substring to try to find in string. */
- {
- register char *a, *b;
-
- /* First scan quickly through the two strings looking for a
- * single-character match. When it's found, then compare the
- * rest of the substring.
- */
-
- b = substring;
- if (*b == 0) {
- return string;
- }
- for ( ; *string != 0; string += 1) {
- if (*string != *b) {
- continue;
- }
- a = string;
- while (1) {
- if (*b == 0) {
- return string;
- }
- if (*a++ != *b++) {
- break;
- }
- }
- b = substring;
- }
- return (char *) 0;
- }
- #endif /* NEED_STRSTR */
-
- void push(p_name, p_type, p_line)
- unsigned char *p_name;
- int p_type;
- int p_line;
- {
- if ( gstackp == gstack_size ) { /* extend stack */
- gstack_size *= 2;
- gstack = (tex_group *)realloc(gstack, gstack_size * sizeof(tex_group));
- if ( gstack == NULL ) {
- fprintf(stderr, "%s: stack out of memory", PROGNAME);
- exit(3);
- }
- }
-
- if ( (gstack[gstackp].s_name =
- (unsigned char *)malloc(strlen(p_name) + 1)) == NULL ||
- (gstack[gstackp].s_file =
- (char *)malloc(strlen(file_name) + 1)) == NULL ) {
- fprintf(stderr, "%s: out of memory\n", PROGNAME);
- exit(3);
- }
-
- strcpy(gstack[gstackp].s_name,p_name);
- gstack[gstackp].s_type = p_type;
- gstack[gstackp].s_line = p_line;
- strcpy(gstack[gstackp].s_file,file_name);
- ++gstackp;
-
- }
-
- void input_file(file_nam)
- char *file_nam;
- {
- char *tmp_file_name;
- FILE *tmp_yyin;
-
- if ( (tmp_file_name = malloc(strlen(file_nam) + 5)) == NULL ) {
- fprintf(stderr, "%s: out of memory\n", PROGNAME);
- exit(3);
- }
- strcpy(tmp_file_name,file_nam);
-
- if (istackp == istack_size) { /* extend stack */
- istack_size *= 2;
- istack = (input_ *)realloc(istack, istack_size * sizeof(input_));
- if ( istack == NULL ) {
- fprintf(stderr, "%s: \\input stack out of memory\n", PROGNAME);
- exit(3);
- }
- }
-
- istack[istackp].stream = YY_CURRENT_BUFFER;
- istack[istackp].linenum = line_count;
- istack[istackp].name = file_name;
- ++istackp;
-
- if ((tmp_yyin = fopen( file_nam, "r")) != NULL )
- {
- yyin = tmp_yyin;
- yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
- file_name = tmp_file_name;
- push(file_name, 3, 1);
- line_count = 1;
- }
- else {
- (void) strcat(tmp_file_name, ".tex");
- if ((tmp_yyin = fopen( tmp_file_name , "r")) != NULL )
- {
- yyin = tmp_yyin;
- yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
- file_name = tmp_file_name;
- push(file_name, 3, 1);
- line_count = 1;
- }
- else
- {
- --istackp;
- fclose(tmp_yyin);
- free(tmp_file_name);
- printf("\"%s\", line %d: Could not open \"%s\"\n",
- file_name,
- line_count,
- file_nam);
- input();
- }
- }
- }
-
- void pop()
- {
- if ( gstackp == 0 )
- {
- fprintf(stderr, "%s: Stack underflow\n", PROGNAME);
- exit(4);
- }
- --gstackp;
-
- free(gstack[gstackp].s_name);
- free(gstack[gstackp].s_file);
- }
-
- char *bg_command(name)
- char *name;
- {
-
- switch (CG_TYPE) {
-
- case 2:
- (void) strcpy( returnval, "\\begin\{" );
- (void) strcat( returnval, (char *) name);
- (void) strcat( returnval, "}" );
- break;
-
- case 3:
- (void) strcpy( returnval, "beginning of file " );
- (void) strcat( returnval, (char *) name);
- break;
-
- case 4:
- (void) strcpy( returnval, "math begin " );
- (void) strcat( returnval, (char *) name);
- break;
-
- case 5:
- (void) strcpy( returnval, "display math begin " );
- (void) strcat( returnval, (char *) name);
- break;
-
- default:
- (void) strcpy( returnval, name );
-
- }
-
- return ((char *)returnval);
- }
-
- char *eg_command(name,type)
- int type;
- char *name;
- {
-
- switch (type) {
-
- case 2:
- (void) strcpy( returnval, "\\end{" );
- (void) strcat( returnval, (char *) name);
- (void) strcat( returnval, "}" );
- break;
-
- case 3:
- (void) strcpy( returnval, "end of file " );
- (void) strcat( returnval, (char *) name);
- break;
-
- case 4:
- (void) strcpy( returnval, "math end " );
- (void) strcat( returnval, (char *) name);
- break;
-
- case 5:
- (void) strcpy( returnval, "display math end " );
- (void) strcat( returnval, (char *) name);
- break;
-
- default:
- (void) strcpy( returnval, name );
- break;
- }
-
- return ((char *)returnval);
- }
-
-
- void g_checkend(n)
- int n;
- {
- if ( check_top_level_end(yytext,n) == 1 )
- if ( CG_TYPE != n )
- print_bad_match(yytext,n);
- else
- pop();
- }
-
- void e_checkend(n, name)
- int n;
- char *name;
- {
- if ( check_top_level_end(name,n) == 1 )
- {
- if ( CG_TYPE != n || strcmp( CG_NAME, name ) != 0 )
- print_bad_match(name,n);
-
- pop();
-
- }
- }
-
- void f_checkend(name)
- char *name;
- {
- if ( check_top_level_end(name,3) == 1 )
- {
- if ( CG_TYPE != 3 || strcmp( CG_NAME, name ) != 0 )
-
- while( CG_TYPE != 3 )
- {
- print_bad_match(name,3);
- pop();
- }
-
- pop();
- }
- }
-
- void print_bad_match(end_command,type)
- char *end_command;
- int type;
- {
- printf("\"%s\", line %i: <- unmatched \"%s\"\n",
- file_name,
- line_count,
- eg_command( end_command , type) ) ;
-
- printf("\"%s\", line %i: -> unmatched \"%s\"\n",
- CG_FILE,
- CG_LINE,
- bg_command( CG_NAME ) ) ;
- warn_count += 2;
- }
-
- int check_top_level_end(end_command,type)
- char *end_command;
- int type;
- {
- if ( gstackp == 0 )
- {
- printf("\"%s\", line %i: \"%s\" found at top level\n",
- file_name,
- line_count,
- eg_command( end_command, type )) ;
- ++warn_count;
- return(0);
- }
- else
- return(1);
- }
-
-
-
-